package com.fita.wechat.service;

import com.fita.entity.agent.Agent;
import com.fita.entity.agent.AgentApply;

import java.util.List;

/**
 * 
 * @author dan
 *
 */
public interface AgentService {
    
    /**
     * 
     * @param id
     * @return
     */
    public Agent load(Long id);
    
    /**
     * 
     * @param mobile
     * @return
     */
    public Agent loadByMobile(String mobile);
    
    /**
     * 
     * @param openid
     * @return
     */
    public Agent loadByOpenid(String openid);
    
    /**
     * 
     * @param mobile
     * @param openid
     */
    public void login(String mobile, String openid);
    
    /**
     * 
     * @param agent
     */
    public void update(Agent agent);

    /**
     * 列出二级代理
     * @param primaryAgentId
     * @return
     */
    List<Agent> listSecondaryAgent(Long primaryAgentId);

    /**
     * 列出二级代理申请
     * @param primaryAgentId
     * @return
     */
    List<AgentApply> listSecondaryAgentApply(Long primaryAgentId);

    /**
     * 修改提成率
     * @param primaryAgentId
     * @param secondaryAgentId
     * @param rate
     */
    void changeSecondaryAgentCommissionRate(Long primaryAgentId, Long secondaryAgentId, Integer rate);
}
